﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SiGeSIB.Data.Security;
using SiGeSIB.Data.Management;
using SiGeSIB.Data.Finances;
using SiGeSIB.Data.Common;

namespace SiGeSIB.Services
{
	public interface IServicesProvider
	{
		#region Methods
		IFinancesServicesProvider CreateFinancesServicesProvider();
		IManagementServicesProvider CreateManagementServicesProvider();
		ISecurityServicesProvider CreateSecurityServicesProvider();
		IBackupRestorationServicesProvider CreateBackupRestorationServicesProvider();
		IReportServicesProvider CreateReportServicesProvider();
		#endregion
	}

	#region Interfaces
	public interface IFinancesServicesProvider
	{
		int InsertMovimentation(Movimentation movimentation);
		void UpdateMovimentation(Movimentation movimentation);
		void RemoveMovimentation(int id);

		int InsertCostCenter(CostCenter center);
		void UpdateCostCenter(CostCenter center);
		void RemoveCostCenter(int id);

		CostCenter GetCostCenter(int id, CostCenterInfo info);
		List<CostCenter> GetCostCenters(CostCenterInfo info);
		List<CostCenter> GetCostCenters(int[] ids, CostCenterInfo info);

		Movimentation GetMovimentation(int id);
		List<Movimentation> GetMovimentations(MovimentationFilter filter, MovimentationInfo info);
	}
	public interface IManagementServicesProvider
	{
		int InsertContributor(Contributor contributor);
		void UpdateContributor(Contributor contributor);
		void RemoveContributor(int id);
		Contributor GetContributor(int id);
		List<Contributor> GetContributors(EContributorType type);
		List<Contributor> GetContributors(int[] ids);

		Dictionary<string, Address> GetAddresses();
	}
	public interface ISecurityServicesProvider
	{
		User Login(string login, string password);

		User GetUser(int iduser);
		List<User> GetUsers();
		List<User> GetUsers(int[] ids);

		int InsertUser(User user);
		void UpdateUser(User user);
		void RemoveUser(int id);

		EPermissions GetUserPermissions(int idUser);
		void SaveUserPermissions(int userId, EPermissions permission);
	}
	public interface IBackupRestorationServicesProvider 
	{
		void Backup(string fileName);
		void RestoreBackup(string fileName);
	}
	public interface IReportServicesProvider
	{
		void GenerateReport(List<CostCenter> centros, string filePath, EMovimentationType type, DateTimeInterval interval);
	}
	#endregion
}
